<!--
 * @Date: 2023-03-21 15:54:12
 * @LastEditTime: 2023-04-04 12:32:43
 * @FilePath: /nlk/src/views/me/components/bonusLogs.vue
 * 介绍:
-->
<script lang="ts" setup>
import { FreedLogs, apiFreedLogs } from "@@/api/module/pagingList";
import CrequestList from "@@/components/common/CrequestList/CrequestList.vue";
import dayjs from "dayjs";

const CrequestListRef = ref<InstanceType<typeof CrequestList>>();

function apiReset() {
  return CrequestListRef.value!.apiReset();
}
defineExpose({ apiReset });
</script>

<template>
  <h3>{{ $t("jiang-jin-ming-xi") }}</h3>
  <CrequestList
    ref="CrequestListRef"
    :pull-refresh="false"
    :api="apiFreedLogs"
    min-height="400rem"
    sticky="sticky"
    offset-top="var(--gap-md)"
  >
    <template #header>
      <Cgrid col="2">
        <CgridItem>{{ $t("jin-e") }}</CgridItem>
        <CgridItem>{{ $t("shi-jian") }}</CgridItem>
        <!-- <CgridItem >{{ $t("bei-zhu") }}</CgridItem> -->
      </Cgrid>
    </template>
    <template #item="{ item }: { item: FreedLogs.ResItem }">
      <Cgrid col="2" class="list-item">
        <CgridItem class="C-M1">{{ item.money }}</CgridItem>
        <CgridItem>
          {{ dayjs(item.created_at).format("MM/DD HH:mm") }}
        </CgridItem>
        <!-- <CgridItem >{{ item.remark }}</CgridItem> -->
      </Cgrid>
    </template>
  </CrequestList>
</template>

<style lang="less" scoped>
.list-item {
  border-bottom: 1rem solid var(--C-OT3);
  padding: var(--gap-md) 0;
}
</style>
